package crazy.memory1;

public class Sub1 extends Mid1
{
	int count = 200;
	
	public static void main(String[] args)
	{
		Sub1 s = new Sub1();
		Mid1 s2m = s;
		
		Base1 s2b = s;
		System.out.println(s.count);
		System.out.println(s2m.count);
		System.out.println(s2b.count);
		s.accessMid();
	}
	
	public void accessMid()
	{
		System.out.println(super.count);
		System.out.println(super.getClass());
		System.out.println(this.getClass());
	}
}

class Base1
{
	int count = 2;
}

class Mid1 extends Base1
{
	int count = 20;
}
